﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SystemWnioskujacy.Exceptions {
    public class IncorrectNameException : SyntaxErrorException {
        public static string MESSAGE = SyntaxErrorException.MESSAGE + "Incorrect name for entity!";

		public IncorrectNameException() : base(MESSAGE) {
		}

		/// <summary>
		///	Generate message about incorrect name.
		/// </summary>
		/// <param name="name">Name.</param>
        public IncorrectNameException(string name)
            : base(GenerateMessage(name))
		{
        }

		/// <summary>
		///	Generate message about incorrect name.
		/// </summary>
		/// <param name="name">Name.</param>
		/// <param name="inner">Inner exception.</param>
        public IncorrectNameException(string name, Exception inner)
            : base(GenerateMessage(name), inner) {
        }
		
		/// <summary>
		///	Generate message about incorrect name.
		/// </summary>
		/// <param name="name">Name.</param>
		private static string GenerateMessage(string name) {
            return string.Format("Name \"{0}\" is not correct for set of facts, rule and variable!", name);
		}
	}
}
